
function proxy() {
    export http_proxy="http://192.168.4.15:8080"
    export ftp_proxy="http://192.168.4.15:8080"
    export https_proxy="http://192.168.4.15:8080"
}

function SERV
{
	case $1 in
		"52")
		    ssh -X dsqiu@192.168.3.52
		    ;;
		"15")
		    ssh -X dsqiu@192.168.4.15
		    ;;
		*)
		    ssh -X dsqiu@$1
		    ;;
	esac
}
alias proxy-apt='sudo apt-get -o Acquire::http::proxy=http://192.168.4.15:8080'
alias emacsserver='emacs --daemon'

alias minicom='env LANG=en_US minicom'

function androidenv()
{
    docker ps | grep android
    if [ $? == 0 ];then
        docker attach android
    fi
    docker ps -a | grep android
    if [ $? == 0 ]; then
        docker rm android
    fi
    docker run -d -v /home/android:/home/android  -w $PWD -u user --name "android" -it android7.1:latest /bin/bash
    docker attach android
}
function buildenv()
{
    docker ps | grep build
    if [ $? == 0 ];then
        docker attach build
    fi
    docker ps -a | grep build
    if [ $? == 0 ]; then
        docker rm build
    fi
    docker run -d -v /home/dsqiu:/home/dsqiu -w $PWD -u dsqiu --name "build" -it ubuntu20.04:v4 /bin/bash
    docker attach build
}

function enterbuild()
{
    docker stop build
    docker rm build
    docker run -d -v /home/dsqiu:/home/dsqiu -w $PWD --name "build" -it ubuntu20.04:$1 /bin/bash
    docker attach build
}

function set-title() {
  if [[ -z "$ORIG" ]]; then
    ORIG=$PS1
  fi
  TITLE="\[\e]2;$*\a\]"
  PS1=${ORIG}${TITLE}
}

function datamount() {
	echo linux123 | sudo -S mount -o bind /home/data /home/dsqiu/work/data
}

if [ "$SSH_TTY" != "" ];then
export LIBGL_ALWAYS_INDIRECT=1
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
ps -x | grep "fcitx " > /dev/null
if [ $? != 0 ];then
   fcitx -d &
fi
fi
alias et='emacsclient -nw -a emacs'
alias ec='emacsclient -c -a emacs'
#export REPO_URL="ssh://10.1.1.26:29418/AOSP/git-repo.git"
#alias meld='sudo -u dsqiu meld'
unset XDG_RUNTIME_DIR
unset DBUS_SESSION_BUS_ADDRESS
#export REPO_URL="http://git1.ingenic.com.cn:8082/gerrit/AOSP/git-repo-2.45"
